import { App } from 'vue'

const modulesFiles: any = import.meta.globEager('../directives/**/*index.ts')

export function registerGlobalDirective(app: App<Element>) {
  for (const path in modulesFiles) {
    const moduleName: string = path.replace('../directives/', '').split('/')[0]
    app.directive(moduleName, modulesFiles[path].default)
  }
}
